package com.eascs.web.o2o.web.controller;

import com.eascs.app.dao.PageResult;
import com.eascs.common.util.StringUtil;
import com.eascs.common.util.UrlUtil;
import com.eascs.report.common.entity.ProvinceTeamTotalForm;
import com.eascs.site.controller.BaseRestController;
import com.eascs.site.page.PaginationInfo;
import com.eascs.site.page.SelectDataOption;
import com.eascs.site.view.BaseRestResult;
import com.eascs.site.view.PaginationRestResult;
import com.eascs.site.view.ViewContext;
import com.eascs.site.view.button.Button;
import com.eascs.site.view.button.ButtonHelper;
import com.eascs.site.view.button.RedirectButton;
import com.eascs.site.view.button.ShowButtonFilter;
import com.eascs.web.o2o.web.service.ReportStatService;

import java.text.DecimalFormat;
import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/pttRest")
public class ProvinceTeamTotalRestController extends BaseRestController {
	@Autowired
	ReportStatService reportStatService;

	// 根据团队查询报表
	@RequestMapping("/o2oTeam")
	public PaginationRestResult o2oTeam(ProvinceTeamTotalForm entity) {
		String o2ourl = "/pttRest/o2oTeam";
		String statisticDate  = entity.getStatisticDate() == null ? "" : entity.getStatisticDate();
		if (entity != null) {
			String province = entity.getProvince() == null ? null : entity.getProvince();
			String auditorName   = entity.getAuditorName() == null ? null : entity.getAuditorName();
			statisticDate  = entity.getStatisticDate() == null ? "" : entity.getStatisticDate();
			String auditorNameNo   = entity.getAuditorNameNo() == null ? null : entity.getAuditorNameNo();
			String isDimission    = entity.getIsDimission() == null ? "" : entity.getIsDimission();
			String joinDateStart   = entity.getJoinDateStart() == null ? null : entity.getJoinDateStart();
			String joinDateEnd   = entity.getJoinDateEnd() == null ? null : entity.getJoinDateEnd();
			String postCode   = entity.getPostCode() == null ? null : entity.getPostCode();
			String postName   = entity.getPostName() == null ? null : entity.getPostName();
			o2ourl = UrlUtil.appendUrl(o2ourl, "postCode", postCode);
			o2ourl = UrlUtil.appendUrl(o2ourl, "postName", postName);
			o2ourl = UrlUtil.appendUrl(o2ourl, "joinDateStart", joinDateStart);
			o2ourl = UrlUtil.appendUrl(o2ourl, "joinDateEnd", joinDateEnd);
			o2ourl = UrlUtil.appendUrl(o2ourl, "isDimission", isDimission);
			o2ourl = UrlUtil.appendUrl(o2ourl, "province", province);
			o2ourl = UrlUtil.appendUrl(o2ourl, "auditorName", auditorName);
			o2ourl = UrlUtil.appendUrl(o2ourl, "statisticDate", statisticDate);
			o2ourl = UrlUtil.appendUrl(o2ourl, "auditorNameNo", auditorNameNo);
		
			o2ourl = o2ourl + "&o2oIndex=";
		} else {
			o2ourl = o2ourl + "?o2oIndex=";
		}
		entity.setPageSize(10000);
		//查看团队长下得成员详情
		Button showButton =ButtonHelper.createOpenButton("", "/ptt/reportStatByOperator?statisticDate="+statisticDate+"&auditorName={1}");
		//showButton.setPermissionCode("showCustomer");
		showButton.setShowButtonFilter(new ShowButtonFilter() {
			@Override
			public boolean filter(Object param) {
				return true;
			}
		});
		Button[] detailButton = new Button[] {null, showButton};
		PageResult<Object[]> pageResult = reportStatService.getTeamTotalByPageForExcle(entity);

		String titles[] = { "省区", "团队负责人","团队长入职时间", "团队长入职状态", "团队长岗位名称", "前一天团队放款金额（万元）", "当天团队放款笔数", "当天团队放款金额（万元）", "当天团队新客户放款总额（万元）", 
				"当月团队放款笔数", "当月团队放款金额（万元）", "当月团队新客户放款金额（万元）", "前一个月团队放款金额（万元）",
				"前一个月新客户放款金额（万元）","当年团队放款金额（万元）" };
		SelectDataOption[] selectDataOptions = { null, null,  null, null, null,null, null, null, null, null , null, null, null, null, null};
		PaginationInfo o2oPagingInfo = new PaginationInfo(pageResult, titles, o2ourl);
		o2oPagingInfo.setFormats(new Format[] { null,null,new SimpleDateFormat("yyyy-MM-dd"),null,null, null, null, null, null,null, null, null, null, null});
		o2oPagingInfo.setBuildPagingNavigation(false);
		o2oPagingInfo.setFirstRenderColumnIndex(0);
		o2oPagingInfo.setTitleButtons(detailButton);
		o2oPagingInfo.setSelectDataOptions(selectDataOptions);
		o2oPagingInfo.setRendTo("#o2o_team");
		o2oPagingInfo.setBuildRowNumber(true);
		ViewContext.put("vo", entity);
		return PaginationRestResult.buildPaginationRestResult(o2oPagingInfo);
	}

	// 根据省区查询报表
	@RequestMapping("/o2oProvince")
	public PaginationRestResult o2oProvince(ProvinceTeamTotalForm entity) {
		String o2ourl = "/pttRest/o2oProvince";

		if (entity != null) {
			String province = entity.getProvince() == null ? null : entity.getProvince();
			String statisticDate = entity.getStatisticDate() == null ? "" : entity.getStatisticDate();
			o2ourl = UrlUtil.appendUrl(o2ourl, "province", province);
			o2ourl = UrlUtil.appendUrl(o2ourl, "statisticDate", statisticDate);
			o2ourl = o2ourl + "&o2oIndex=";
		} else {
			o2ourl = o2ourl + "?o2oIndex=";
		}
		entity.setPageSize(10000);
		PageResult<Object[]> pageResult = reportStatService.getProvinceTotalByPage(entity);

		String titles[] = { "省区", " 前一天新客户放款金额（万元）", " 前一天放款金额（万元）", "当天新客户放款金额（万元）","当天放款金额（万元）","前一个月新客户放款金额（万元）", "前一个月放款金额（万元）","当月新客户放款金额（万元）", "当月放款金额（万元）", "当年新客户放款金额（万元）", "当年放款金额（万元）" };
		SelectDataOption[] selectDataOptions = { null, null, null, null, null, null, null, null, null, null, null };
		PaginationInfo o2oPagingInfo = new PaginationInfo(pageResult, titles, o2ourl);
		o2oPagingInfo.setBuildPagingNavigation(false);
		o2oPagingInfo.setFirstRenderColumnIndex(0);
		o2oPagingInfo.setSelectDataOptions(selectDataOptions);
		o2oPagingInfo.setRendTo("#o2o_province");
		o2oPagingInfo.setBuildRowNumber(true);
		ViewContext.put("vo", entity);
		return PaginationRestResult.buildPaginationRestResult(o2oPagingInfo);
	}

	// 根据经办人查询报表
	@RequestMapping("/o2oOperator")
	public PaginationRestResult o2oOperator(ProvinceTeamTotalForm entity) {
		String o2ourl = "/pttRest/o2oOperator";

		if (entity != null) {
			String statisticDate  = entity.getStatisticDate() == null ? "" : entity.getStatisticDate();
			String joinDateStart   = entity.getJoinDateStart() == null ? null : entity.getJoinDateStart();
			String joinDateEnd   = entity.getJoinDateEnd() == null ? null : entity.getJoinDateEnd();
			String province      = entity.getProvince() == null ? "" : entity.getProvince();
			String isDimission    = entity.getIsDimission() == null ? "" : entity.getIsDimission();
			String operatorName  = entity.getOperatorName() == null ? "" : entity.getOperatorName();
			String postCode   = entity.getPostCode() == null ? null : entity.getPostCode();
			String postName   = entity.getPostName() == null ? null : entity.getPostName();
			String auditorName   = entity.getAuditorName() == null ? null : entity.getAuditorName();
			String auditorNameNo   = entity.getAuditorNameNo() == null ? null : entity.getAuditorNameNo();
			o2ourl = UrlUtil.appendUrl(o2ourl, "postCode", postCode);
			o2ourl = UrlUtil.appendUrl(o2ourl, "postName", postName);
			o2ourl = UrlUtil.appendUrl(o2ourl, "joinDateStart", joinDateStart);
			o2ourl = UrlUtil.appendUrl(o2ourl, "joinDateEnd", joinDateEnd);
			o2ourl = UrlUtil.appendUrl(o2ourl, "province", province);
			o2ourl = UrlUtil.appendUrl(o2ourl, "isDimission", isDimission);
			o2ourl = UrlUtil.appendUrl(o2ourl, "operatorName", operatorName);
			o2ourl = UrlUtil.appendUrl(o2ourl, "statisticDate", statisticDate);
			o2ourl = UrlUtil.appendUrl(o2ourl, "auditorName", auditorName);
			o2ourl = UrlUtil.appendUrl(o2ourl, "auditorNameNo", auditorNameNo);
			o2ourl = o2ourl + "&o2oIndex=";
		} else {
			o2ourl = o2ourl + "?o2oIndex=";
		}
		entity.setPageSize(10000);
		PageResult<Object[]> pageResult = reportStatService.getOperatorTotalByPageForExcle(entity);

		String titles[] = {"省区", "团队负责人", "信贷经理", "岗位名称","入职时间", "入职状态", "前一天新客户放款金额（万元）","前一天放款金额（万元）",  "当天新客户放款金额（万元）","当天放款金额（万元）", "前一个月新客户放款金额（万元）","前一个月放款金额（万元）", "当月新客户放款金额（万元）","当月放款金额（万元）", "当年新客户放款金额（万元）","当年放款金额（万元）" };
		SelectDataOption[] selectDataOptions = { null,null, null,null, null, null, null, null, null, null , null , null ,null, null, null, null, null};
		PaginationInfo o2oPagingInfo = new PaginationInfo(pageResult, titles, o2ourl);
		o2oPagingInfo.setFormats(new Format[] { null,null,null,null,new SimpleDateFormat("yyyy-MM-dd"),null,null, null, null, null, null,null, null, null, null, null});
		o2oPagingInfo.setBuildPagingNavigation(false);
		o2oPagingInfo.setFirstRenderColumnIndex(0);
		o2oPagingInfo.setSelectDataOptions(selectDataOptions);
		o2oPagingInfo.setRendTo("#o2o_operator");
		o2oPagingInfo.setBuildRowNumber(true);
		ViewContext.put("vo", entity);
		return PaginationRestResult.buildPaginationRestResult(o2oPagingInfo);
	}

	@RequestMapping(value = "/search/employee")
	public BaseRestResult<List<Object[]>> employee(String empName) {
		List<Object[]> data = new ArrayList<>();
		if (StringUtil.hasText(empName)) {
			data = reportStatService.getLikeEmployeeList(empName);
		}
		return BaseRestResult.buildRestResult(data);
	}
	
	
	
	// 根据团队查询报表
		@RequestMapping("/o2oSectionTeam")
		public PaginationRestResult o2oSectionTeam(ProvinceTeamTotalForm entity) {
			String o2ourl = "/pttRest/o2oSectionTeam";

			String loanDateStart  = entity.getLoanDateStart() == null ? "" : entity.getLoanDateStart();
			String loanDateEnd  = entity.getLoanDateEnd() == null ? "" : entity.getLoanDateEnd();
			if (entity != null) {
				String province = entity.getProvince() == null ? null : entity.getProvince();
				String auditorName   = entity.getAuditorName() == null ? null : entity.getAuditorName();
				loanDateStart  = entity.getLoanDateStart() == null ? "" : entity.getLoanDateStart();
				loanDateEnd  = entity.getLoanDateEnd() == null ? "" : entity.getLoanDateEnd();
				String auditorNameNo   = entity.getAuditorNameNo() == null ? null : entity.getAuditorNameNo();
				String isDimission    = entity.getIsDimission() == null ? "" : entity.getIsDimission();
				String joinDateStart   = entity.getJoinDateStart() == null ? null : entity.getJoinDateStart();
				String joinDateEnd   = entity.getJoinDateEnd() == null ? null : entity.getJoinDateEnd();
				String postCode   = entity.getPostCode() == null ? null : entity.getPostCode();
				String postName   = entity.getPostName() == null ? null : entity.getPostName();
				o2ourl = UrlUtil.appendUrl(o2ourl, "postCode", postCode);
				o2ourl = UrlUtil.appendUrl(o2ourl, "postName", postName);
				o2ourl = UrlUtil.appendUrl(o2ourl, "joinDateStart", joinDateStart);
				o2ourl = UrlUtil.appendUrl(o2ourl, "joinDateEnd", joinDateEnd);
				o2ourl = UrlUtil.appendUrl(o2ourl, "isDimission", isDimission);
				o2ourl = UrlUtil.appendUrl(o2ourl, "province", province);
				o2ourl = UrlUtil.appendUrl(o2ourl, "auditorName", auditorName);
				o2ourl = UrlUtil.appendUrl(o2ourl, "loanDateStart", loanDateStart);
				o2ourl = UrlUtil.appendUrl(o2ourl, "loanDateEnd", loanDateEnd);
				o2ourl = UrlUtil.appendUrl(o2ourl, "auditorNameNo", auditorNameNo);
				o2ourl = o2ourl + "&o2oIndex=";
			} else {
				o2ourl = o2ourl + "?o2oIndex=";
			}
			entity.setPageSize(10000);
			PageResult<Object[]> pageResult = reportStatService.getTeamTotalSectionByPageForExcle(entity);

			//查看团队长下得成员详情
			Button showButton = ButtonHelper.createOpenButton("", "/ptt/reportStatBySectionOperator?loanDateStart="+loanDateStart+"&loanDateEnd="+loanDateEnd+"&auditorName={1}");
			//showButton.setPermissionCode("delAcq"); // 权限按钮
			showButton.setShowButtonFilter(new ShowButtonFilter() {
				@Override
				public boolean filter(Object param) {
					return true;
				}
			});
			Button[] detailButton = new Button[] {null, showButton};
			
			
			String titles[] = { "省区", "团队负责人","团队长入职时间", "团队长入职状态", "团队长岗位名称","团队放款总笔数", "团队放款总金额（万元）", "新客户放款总笔数", "新客户放款总金额（万元）" };
			SelectDataOption[] selectDataOptions = { null, null, null, null, null, null, null, null, null, null};
			PaginationInfo o2oPagingInfo = new PaginationInfo(pageResult, titles, o2ourl);
			o2oPagingInfo.setFormats(new Format[] { null, null, new SimpleDateFormat("yyyy-MM-dd"), null, null, null, null, null, null, null});
			o2oPagingInfo.setBuildPagingNavigation(false);
			o2oPagingInfo.setFirstRenderColumnIndex(0);
			o2oPagingInfo.setSelectDataOptions(selectDataOptions);
			o2oPagingInfo.setTitleButtons(detailButton);
			o2oPagingInfo.setRendTo("#o2o_section_team");
			o2oPagingInfo.setBuildRowNumber(true);
			ViewContext.put("vo", entity);
			return PaginationRestResult.buildPaginationRestResult(o2oPagingInfo);
		}

		// 根据省区查询报表
		@RequestMapping("/o2oSectionProvince")
		public PaginationRestResult o2oSectionProvince(ProvinceTeamTotalForm entity) {
			String o2ourl = "/pttRest/o2oSectionProvince";

			if (entity != null) {
				String province = entity.getProvince() == null ? null : entity.getProvince();
				String loanDateStart  = entity.getLoanDateStart() == null ? "" : entity.getLoanDateStart();
				String loanDateEnd  = entity.getLoanDateEnd() == null ? "" : entity.getLoanDateEnd();			
				o2ourl = UrlUtil.appendUrl(o2ourl, "province", province);
				o2ourl = UrlUtil.appendUrl(o2ourl, "loanDateStart", loanDateStart);
				o2ourl = UrlUtil.appendUrl(o2ourl, "loanDateEnd", loanDateEnd);
				o2ourl = o2ourl + "&o2oIndex=";
			} else {
				o2ourl = o2ourl + "?o2oIndex=";
			}
			entity.setPageSize(10000);
			PageResult<Object[]> pageResult = reportStatService.getProvinceTotalSectionByPage(entity);

			String titles[] = { "省区","放款总笔数","放款总金额（万元）","新客户放款总笔数","新客户放款总金额（万元）"};
			SelectDataOption[] selectDataOptions = { null, null, null, null, null, null};
			PaginationInfo o2oPagingInfo = new PaginationInfo(pageResult, titles, o2ourl);
			o2oPagingInfo.setBuildPagingNavigation(false);
			o2oPagingInfo.setFirstRenderColumnIndex(0);
			o2oPagingInfo.setSelectDataOptions(selectDataOptions);
			o2oPagingInfo.setRendTo("#o2o_section_province");
			o2oPagingInfo.setBuildRowNumber(true);
			ViewContext.put("vo", entity);
			return PaginationRestResult.buildPaginationRestResult(o2oPagingInfo);
		}

		// 根据经办人查询报表
		@RequestMapping("/o2oSectionOperator")
		public PaginationRestResult o2oSectionOperator(ProvinceTeamTotalForm entity) {
			String o2ourl = "/pttRest/o2oSectionOperator";

			if (entity != null) {
				String loanDateStart = entity.getLoanDateStart() == null ? null : entity.getLoanDateStart();
				String loanDateEnd   = entity.getLoanDateEnd() == null ? null : entity.getLoanDateEnd();
				String joinDateStart   = entity.getJoinDateStart() == null ? null : entity.getJoinDateStart();
				String joinDateEnd   = entity.getJoinDateEnd() == null ? null : entity.getJoinDateEnd();
				String province      = entity.getProvince() == null ? "" : entity.getProvince();
				String isDimission   = entity.getIsDimission() == null ? "" : entity.getIsDimission();
				String operatorName  = entity.getOperatorName() == null ? "" : entity.getOperatorName();
				String postCode   = entity.getPostCode() == null ? null : entity.getPostCode();
				String postName   = entity.getPostName() == null ? null : entity.getPostName();
				String auditorName   = entity.getAuditorName() == null ? null : entity.getAuditorName();
				String auditorNameNo   = entity.getAuditorNameNo() == null ? null : entity.getAuditorNameNo();
				o2ourl = UrlUtil.appendUrl(o2ourl, "postCode", postCode);
				o2ourl = UrlUtil.appendUrl(o2ourl, "postName", postName);
				o2ourl = UrlUtil.appendUrl(o2ourl, "loanDateStart", loanDateStart);
				o2ourl = UrlUtil.appendUrl(o2ourl, "loanDateEnd", loanDateEnd);
				o2ourl = UrlUtil.appendUrl(o2ourl, "joinDateStart", joinDateStart);
				o2ourl = UrlUtil.appendUrl(o2ourl, "joinDateEnd", joinDateEnd);
				o2ourl = UrlUtil.appendUrl(o2ourl, "province", province);
				o2ourl = UrlUtil.appendUrl(o2ourl, "isDimission", isDimission);
				o2ourl = UrlUtil.appendUrl(o2ourl, "operatorName", operatorName);
				o2ourl = UrlUtil.appendUrl(o2ourl, "auditorName", auditorName);
				o2ourl = UrlUtil.appendUrl(o2ourl, "auditorNameNo", auditorNameNo);
				o2ourl = o2ourl + "&o2oIndex=";
			} else {
				o2ourl = o2ourl + "?o2oIndex=";
			}
			entity.setPageSize(10000);
			PageResult<Object[]> pageResult = reportStatService.getOperatorTotalSectionByPageForExcle(entity);

			String titles[] = {"省区", "团队负责人", "信贷经理",  "岗位名称","入职时间", "入职状态", "放款总笔数","放款总金额（万元）",  "新客户放款总笔数","新客户放款总金额（万元）"};
			SelectDataOption[] selectDataOptions = {null, null,null, null, null, null, null, null, null, null , null};
			PaginationInfo o2oPagingInfo = new PaginationInfo(pageResult, titles, o2ourl);
			o2oPagingInfo.setFormats(new Format[] {null,null, null,null,new SimpleDateFormat("yyyy-MM-dd"),null,null, null, null, null});
			o2oPagingInfo.setBuildPagingNavigation(false);
			o2oPagingInfo.setFirstRenderColumnIndex(0);
			o2oPagingInfo.setSelectDataOptions(selectDataOptions);
			o2oPagingInfo.setRendTo("#o2o_section_operator");
			o2oPagingInfo.setBuildRowNumber(true);
			ViewContext.put("vo", entity);
			return PaginationRestResult.buildPaginationRestResult(o2oPagingInfo);
		}


		// 根据经办人查询报表
		@RequestMapping("/o2oBankLimit")
		public PaginationRestResult o2oBankLimit(ProvinceTeamTotalForm entity) {
			String o2ourl = "/pttRest/o2oBankLimit";

			if (entity != null) {
				String province = entity.getProvince() == null ? null : entity.getProvince();
				String auditorName   = entity.getAuditorName() == null ? null : entity.getAuditorName();
				String loanDateStart  = entity.getLoanDateStart() == null ? "" : entity.getLoanDateStart();
				String loanDateEnd  = entity.getLoanDateEnd() == null ? "" : entity.getLoanDateEnd();
				String auditorNameNo   = entity.getAuditorNameNo() == null ? null : entity.getAuditorNameNo();
				o2ourl = UrlUtil.appendUrl(o2ourl, "province", province);
				o2ourl = UrlUtil.appendUrl(o2ourl, "auditorName", auditorName);
				o2ourl = UrlUtil.appendUrl(o2ourl, "loanDateStart", loanDateStart);
				o2ourl = UrlUtil.appendUrl(o2ourl, "loanDateEnd", loanDateEnd);
				o2ourl = UrlUtil.appendUrl(o2ourl, "auditorNameNo", auditorNameNo);
				o2ourl = o2ourl + "&o2oIndex=";
			} else {
				o2ourl = o2ourl + "?o2oIndex=";
			}
			entity.setPageSize(10000);
			PageResult<Object[]> pageResult =reportStatService.getBankLimitByPage(entity);

			String titles[] = {"省区", "中国建设银行-湖南", "中国建设银行-深圳", "国安村镇银行","齐鲁银行","兴业银行-济南","江西银行", "郑州银行", "浦发广州分行","三湘银行","中旅银行","中国银行"};
			SelectDataOption[] selectDataOptions = { null, null, null, null, null, null, null, null , null, null , null};
			PaginationInfo o2oPagingInfo = new PaginationInfo(pageResult, titles, o2ourl);
			o2oPagingInfo.setBuildPagingNavigation(false);
			o2oPagingInfo.setFirstRenderColumnIndex(0);
			o2oPagingInfo.setSelectDataOptions(selectDataOptions);
			o2oPagingInfo.setRendTo("#o2o_bank_limit");
			o2oPagingInfo.setBuildRowNumber(true);
			ViewContext.put("vo", entity);
			ViewContext.put("flag", "flag");
			return PaginationRestResult.buildPaginationRestResult(o2oPagingInfo);
		}
		
		
		@RequestMapping(value = "/search/post")
		public BaseRestResult<List<Object[]>> employee(ProvinceTeamTotalForm entity) {
			List<Object[]> data = new ArrayList<>();
			if (StringUtil.hasText(entity.getPostName())) {
				data = reportStatService.getLikePostList(entity);
			}
			return BaseRestResult.buildRestResult(data);
		}
		
		@RequestMapping(value="/o2oBankreFund")
		public PaginationRestResult o2oBankreFund(ProvinceTeamTotalForm entity) {
			String o2ourl = "/pttRest/o2oBankreFund";
			if(entity!=null) {
				String loanDateStart = entity.getLoanDateStart();
				String loanDateEnd = entity.getLoanDateEnd();
				o2ourl = UrlUtil.appendUrl(o2ourl, "loanDateStart", loanDateStart);
				o2ourl = UrlUtil.appendUrl(o2ourl, "loanDateEnd", loanDateEnd);
				o2ourl = o2ourl + "&o2oIndex=";
			} else {
				o2ourl = o2ourl + "?o2oIndex=";
			}
			entity.setPageSize(10000);
			PageResult<Object[]> pageResult = reportStatService.getBankreFundTotalSectionByPage(entity);
			String titles[] = {"放款银行", "放款总笔数", "放款总金额（万元）", "新客户放款总笔数","新客户放款总金额（万元）"};
			SelectDataOption[] selectDataOptions = { null, null, null, null, null};
			PaginationInfo o2oPagingInfo = new PaginationInfo(pageResult, titles, o2ourl);
			o2oPagingInfo.setBuildPagingNavigation(false);
			o2oPagingInfo.setFirstRenderColumnIndex(0);
			o2oPagingInfo.setSelectDataOptions(selectDataOptions);
			o2oPagingInfo.setFormats(new Format[] { null,null, new DecimalFormat(",##0.00"),null, new DecimalFormat(",##0.00")});
			o2oPagingInfo.setRendTo("#o2o_section_bankreFund");
			o2oPagingInfo.setBuildRowNumber(true);
			ViewContext.put("vo", entity);
			return PaginationRestResult.buildPaginationRestResult(o2oPagingInfo);
		}
}
